package com.reflection;

public class Student {
    private String name;
    public String gender;
    private int age;

    //空参
    public Student() {
    }
    //公共
    public Student(String name){
        this.name = name;
    }
    //保护
    protected Student(int age) {
        this.age = age;
    }
    //私有
    private Student(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public void show() {
        System.out.println("公共方法:空参-show()方法");
    }
    public void show(String s) {
        System.out.println("公共方法:"+s+"show()方法");
    }
    private void eat(String s) {
        System.out.println("私有方法:"+s+"吃饭了");
    }
    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return age
     */
    public int getAge() {
        return age;
    }

    /**
     * 设置
     * @param age
     */
    public void setAge(int age) {
        this.age = age;
    }

    /**
     * 获取
     * @return gender
     */
    public String getGender() {
        return gender;
    }

    /**
     * 设置
     * @param gender
     */
    public void setGender(String gender) {
        this.gender = gender;
    }

    @Override
    public String toString() {
        return
                "Student{" +
                        "name='" + name + '\'' +
                        ", gender=" + gender +
                        ", age=" + age +
                        '}';
    }
}